package com.sc.nft.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.dto.ADDEcologyIncomeDetailsConfDTO;
import com.sc.nft.dto.ResonanceServiceCenterCoefficientConfDTO;
import com.sc.nft.entity.EcologyCastConf;
import com.sc.nft.entity.EcologyCastExpendConf;
import com.sc.nft.entity.EcologyHatchConf;
import com.sc.nft.entity.req.ADDEcologyIncomeServiceCenterConfRequest;
import com.sc.nft.entity.req.AddEcologyIncomeCollectionRequest;
import com.sc.nft.entity.req.AddEcologyIncomeConfSingleRequest;
import com.sc.nft.entity.vo.CoefficientVO;
import com.sc.nft.entity.vo.ecology.*;
import com.sc.nft.entity.vo.merchantPledgeTask.AdminEcologyIncomeConfListVO;
import com.sc.nft.enums.EcologyHatchShareProfitMethodConfTypeEnum;
import com.sc.nft.enums.EcologyHatchShareProfitSeparateAccountTypeEnum;

import java.math.BigDecimal;
import java.util.List;

public interface AdminEcologyIncomeConfService {

    /**
     * 新增生态收益配置
     *
     * @param confId                      生态铸造配置id
     * @param platformNotDivideIntoNum    市值管理平台不分成份数
     * @param daoNotDivideIntoNum         市值管理品牌不分成份数
     * @param type                        分润类型
     * @param resonanceStatus             是否开启共振
     * @param resonanceServiceCenterDaoId 共振服务中心DaoId
     * @param confDetailsList             生态配置详情
     */
    void addConf(Long confId, Integer platformNotDivideIntoNum, Integer daoNotDivideIntoNum, EcologyHatchShareProfitMethodConfTypeEnum type, Boolean resonanceStatus, Long resonanceServiceCenterDaoId, List<ADDEcologyIncomeDetailsConfDTO> confDetailsList,
                 List<ResonanceServiceCenterCoefficientConfDTO> resonanceServiceCenterCoefficientConfDTOList);

    /**
     * 获取城市服务中心对应的系数
     *
     * @param resonanceServiceCenterDaoId
     * @param confId
     * @param ecologyHatchConf
     * @param resonanceServiceCenterCoefficientConfDTOList
     * @return
     */
    CoefficientVO getCoefficient(Long resonanceServiceCenterDaoId, Long confId, EcologyHatchConf ecologyHatchConf, List<ResonanceServiceCenterCoefficientConfDTO> resonanceServiceCenterCoefficientConfDTOList);

    /**
     * 获取生态收益配置
     *
     * @param id
     */
    AdminEcologyHatchCollecionShareProfitConfDetailsVO getConfById(Long id);

    /**
     * 更新生态收益配置
     *
     * @param adminEcologyIncomeConfUpdateVO
     */
    void updateConf(AdminEcologyIncomeConfUpdateVO adminEcologyIncomeConfUpdateVO);

    /**
     * 获取生态收益配置列表
     *
     * @param collectionName
     * @param daoName
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<AdminEcologyIncomeConfListVO> getConfList(String collectionName, String daoName, Integer pageNo, Integer pageSize);


    /**
     * 分页查询分成记录
     *
     * @param collectionId
     * @return
     */
    Page<AdminEcologyHatchDivideIntoLogVO> divideIntoPage(Long collectionId, Integer pageNo, Integer pageSize);

    /**
     * 更新双方分账类型
     *
     * @param confId
     * @param separateAccountType
     */
    void updateSeparateAccountType(Long confId, EcologyHatchShareProfitSeparateAccountTypeEnum separateAccountType);

    /**
     * 共振分润系数同步
     */
    void resonanceSeparationCoefficientsAreSynchronized();

    /**
     * 新增生态收益配置
     * @param confId
     * @param singleList
     * @param serviceCenterList
     */
    void addConfNew(Long confId, List<AddEcologyIncomeConfSingleRequest> singleList, List<ADDEcologyIncomeServiceCenterConfRequest> serviceCenterList);

    /**
     * 配置详情
     * @param confId
     * @return
     */
    ADDEcologyIncomeConfNewDetailsVO getNewByConfId(Long confId);

    /**
     * 编辑配置
     * @param confId
     * @param singleList
     * @param serviceCenterList
     */
    void updateConfNew(Long confId, List<AddEcologyIncomeConfSingleRequest> singleList, List<ADDEcologyIncomeServiceCenterConfRequest> serviceCenterList);

    /**
     * 获取收益配置列表(新)
     * @param collectionName
     * @param daoName
     * @param pageNo
     * @param pageSize
     * @return
     */
    IPage<AdminEcologyIncomeConfListVO> getNewConfList(String collectionName, String daoName, Integer pageNo, Integer pageSize);
}
